/*
 * #%L
 * Client
 * %%
 * Copyright (C) 2011 Ractoc.com
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package com.ractoc.opengamefinder.client;

import com.jme3.asset.AssetManager;
import com.jme3.audio.AudioRenderer;
import com.jme3.input.InputManager;
import com.jme3.renderer.ViewPort;

/**
 * This container class is used to make the relevant instances availlable to the
 * GUI plugin. Currently, these are:
 * <ul>
 * <li>AssetManager</li>
 * <li>InputManager</li>
 * <li>AudioRenderer</li>
 * <li>ViewPort</li>
 * </ul>
 * These instances are JME3 specific though. In the future, OGF should also be able to run with plain JWGL.
 * @author Mark
 * @version 0.1
 */
public final class GuiContainer {

    private static GuiContainer instance;

    private AssetManager assetManager;
    private InputManager inputManager;
    private AudioRenderer audioRenderer;
    private ViewPort guiViewPort;

    private GuiContainer() {
    }

    /**
     * Creates a new instance of the GuiContainer, or returns the existing one
     * public static GuiContainer getInstance() {
     * if an instance has alreadyb een created.
     * 
     * @return The GuiContainer instance.
     */
    public static GuiContainer getInstance() {
        if (instance == null) {
            instance = new GuiContainer();
        }
        return instance;
    }

    /**
     * Returns the supplied AssetManager.
     * @return the supplied AssetManager.
     */
    public AssetManager getAssetManager() {
        return assetManager;
    }

    /**
     * Supplies the AssetManager.
     * @param assetManagerParam The supplied AssetManager.
     */
    public void setAssetManager(final AssetManager assetManagerParam) {
        this.assetManager = assetManagerParam;
    }

    /**
     * Returns the supplied InputManager.
     * @return The supplied InputManager.
     */
    public InputManager getInputManager() {
        return inputManager;
    }

    /**
     * Supplies the InputManager.
     * @param inputManagerParam The supplied InputManager.
     */
    public void setInputManager(final InputManager inputManagerParam) {
        this.inputManager = inputManagerParam;
    }

    /**
     * Returns the supplied AudioRenderer.
     * @return The supplied AudioRenderer.
     */
    public AudioRenderer getAudioRenderer() {
        return audioRenderer;
    }

    /**
     * Supplies the AudioRenderer.
     * @param audioRendererParam The supplied AudioRenderer.
     */
    public void setAudioRenderer(final AudioRenderer audioRendererParam) {
        this.audioRenderer = audioRendererParam;
    }

    /**
     * Returns the supplied GuiViewPort.
     * @return The supplied GuiViewPort.
     */
    public ViewPort getGuiViewPort() {
        return guiViewPort;
    }

    /**
     * Supplies the GuiViewPort.
     * @param guiViewPortParam The supplied GuiViewPort.
     */
    public void setGuiViewPort(final ViewPort guiViewPortParam) {
        this.guiViewPort = guiViewPortParam;
    }

}
